home *** CD-ROM | disk | FTP | other *** search
- class §#37§
- {
- static var §#3§ = false;
- var score = 0;
- var §#121§ = 0;
- var §#78§ = 0;
- var §#80§ = 0;
- var §#92§ = 0;
- var §#88§ = 0;
- var §#91§ = 0;
- var §#87§ = 0;
- var §#93§ = 0;
- var §#89§ = 0;
- var §#108§ = 0;
- var §#401§ = 0;
- function §#37§()
- {
- this["#29"] = new Array();
- this["#224"] = new Array();
- this.levelStats = new Array();
- if(eval("#37")["#3"])
- {
- eval("#0").log(this["#2"]() + "created stats object");
- }
- }
- function §#2§()
- {
- return "Stats: ";
- }
- function §#271§(success, §#44§)
- {
- var _loc6_ = eval("#25")["#163"]();
- var _loc7_ = _root["#24"]["#248"]();
- var _loc8_ = _root["#4"]["#9"].onFire;
- this["#121"] = this["#121"] + 1;
- if(!success)
- {
- if(eval("#37")["#3"])
- {
- var _loc9_ = "shots: " + this["#121"] + ", targets: " + this["#80"] + ", baskets: " + this["#78"] + "\n" + "missed shot\n" + "accuracy: " + _root["#11"]["#29"] + "/" + _root["#11"]["#23"];
- _root["#143"].text = _loc9_;
- }
- return undefined;
- }
- this["#78"] = this["#78"] + 1;
- if(_loc7_)
- {
- this["#91"] = this["#91"] + 1;
- }
- else
- {
- this["#92"] = this["#92"] + 1;
- }
- if(_loc6_)
- {
- this["#93"] = this["#93"] + 1;
- }
- this["#29"].push(_root["#11"]["#29"]);
- this["#224"].push(_root["#11"]["#23"]);
- var _loc4_ = §#44§ >= 15 ? Math.floor((§#44§ - 10) / 5) : 0;
- var _loc3_ = 0;
- if(_loc8_ || _loc6_)
- {
- _root["#4"]["#59"] = true;
- _root["#4"].bonusDisplay["#273"]();
- _root["#4"]["#338"] = getTimer() + 1000;
- if(_loc8_)
- {
- _loc3_ += 2;
- }
- if(_loc6_)
- {
- _loc3_ += 3;
- }
- _root["#4"]["bonusX" + _loc3_]["#273"]();
- }
- else
- {
- _loc3_ = 1;
- }
- var _loc5_ = !_loc7_ ? 3 : 2;
- _loc5_ *= _loc3_;
- this.score += _loc5_ + _loc4_;
- this["#108"] += _loc4_;
- _root["#4"]["#60"].score(_loc5_,true);
- _root["#4"]["#60"].score(_loc4_,false);
- _root["#237"].text = _loc5_ + _loc4_;
- if(eval("#37")["#3"])
- {
- _loc9_ = "shots: " + this["#121"] + ", targets: " + this["#80"] + ", baskets: " + this["#78"] + "\n" + "points for this basket: " + _loc5_ + " x" + _loc3_ + "\n" + "consecutive baskets: " + §#44§ + ", streak bonus: " + _loc4_ + "\n" + "accuracy: " + _root["#11"]["#29"] + "/" + _root["#11"]["#23"];
- _root["#143"].text = _loc9_;
- }
- }
- function §#337§()
- {
- var _loc3_ = eval("#25")["#163"]();
- var _loc4_ = _root["#24"]["#248"]();
- this["#80"] = this["#80"] + 1;
- if(_loc4_)
- {
- this["#87"] = this["#87"] + 1;
- }
- else
- {
- this["#88"] = this["#88"] + 1;
- }
- if(_loc3_)
- {
- this["#89"] = this["#89"] + 1;
- }
- }
- function §#361§(level, time)
- {
- var _loc4_ = 0;
- time = Math.round(time);
- if(time > 0)
- {
- _loc4_ = level * 5;
- this.score += _loc4_ + time;
- _root["#4"]["#60"].score(_loc4_,false);
- _root["#4"]["#60"].score(time,false);
- }
- if(eval("#37")["#3"])
- {
- eval("#0").log(this["#2"]() + "adding level stats: " + time + ", " + this["#108"] + ", " + _loc4_ + " (" + (_loc4_ + time) + " bonus points)");
- }
- this.levelStats[level] = [time,this["#108"],_loc4_];
- this["#108"] = 0;
- }
- function §#357§()
- {
- _root["#30"].text = this.score;
- _root["#313"].text = this["#91"] + " / " + this["#87"] + " (" + this["#63"](this["#91"],this["#87"]) + "%)";
- _root["#301"].text = this["#92"] + " / " + this["#88"] + " (" + this["#63"](this["#92"],this["#88"]) + "%)";
- _root["#86"].text = this["#93"] + " / " + this["#89"] + " (" + this["#63"](this["#93"],this["#89"]) + "%)";
- _root["#362"].text = this["#78"] + " / " + this["#80"] + " (" + this["#63"](this["#78"],this["#80"]) + "%)";
- var _loc7_ = 0;
- var _loc6_ = 0;
- var _loc5_ = 0;
- var _loc4_ = 1;
- while(_loc4_ < this.levelStats.length)
- {
- _root["level" + _loc4_ + "_time"].text = Math.floor(this.levelStats[_loc4_][0]);
- _loc7_ += Math.floor(this.levelStats[_loc4_][0]);
- _root["level" + _loc4_ + "_streak"].text = this.levelStats[_loc4_][1];
- _loc6_ += this.levelStats[_loc4_][1];
- _root["level" + _loc4_ + "_complete"].text = this.levelStats[_loc4_][2];
- _loc5_ += this.levelStats[_loc4_][2];
- _loc4_ = _loc4_ + 1;
- }
- _root["#346"].text = _loc7_;
- _root["#319"].text = _loc6_;
- _root["#308"].text = _loc5_;
- if(eval("#37")["#3"])
- {
- eval("#0").log(this["#2"]() + "\n" + this.toString());
- }
- if(eval("#5")["#249"])
- {
- _root["#67"].text = "";
- _root["#67"]._visible = true;
- Selection.setFocus(_root["#67"]);
- var _loc8_ = new Object();
- _loc8_.score = this.score;
- _loc8_.onKeyDown = function()
- {
- if(Key.isDown(13))
- {
- if(eval("#37")["#3"])
- {
- eval("#0").log("saving score " + this.score + " for player " + _root["#67"].text);
- }
- _global["#320"](_root["#67"].text,this.score ^ _global["#381"]);
- _root["#67"].text = "";
- _root["#67"]._visible = false;
- _root["#295"].text = "Your score has been saved.";
- Key.removeListener(this);
- }
- };
- Key.addListener(_loc8_);
- }
- }
- function toString()
- {
- var _loc4_ = "";
- _loc4_ += "Score: " + this.score + "\n";
- _loc4_ += "Shots: " + this["#121"] + "\n";
- _loc4_ += "Baskets: " + this["#78"] + "\n";
- _loc4_ += "Targets: " + this["#80"] + "\n";
- _loc4_ += "Shooting %: " + this["#63"](_root["#4"]["#326"],_root["#4"]["#112"]) + "\n";
- _loc4_ += "Average accuracy: " + this["#272"](this["#29"]) + "/" + this["#272"](this["#224"]) + "\n";
- _loc4_ += "2 point shots: " + this["#91"] + "/" + this["#87"] + " (" + this["#63"](this["#91"],this["#87"]) + "%)" + "\n";
- _loc4_ += "3 point shots: " + this["#92"] + "/" + this["#88"] + " (" + this["#63"](this["#92"],this["#88"]) + "%)" + "\n";
- _loc4_ += "Pressure shots: " + this["#93"] + "/" + this["#89"] + " (" + this["#63"](this["#93"],this["#89"]) + "%)" + "\n";
- var _loc3_ = 1;
- while(_loc3_ < this.levelStats.length)
- {
- _loc4_ += "Level " + _loc3_ + ": time bonus = " + Math.floor(this.levelStats[_loc3_][0]) + ", streak bonus = " + this.levelStats[_loc3_][1] + ", completion bonus = " + this.levelStats[_loc3_][2] + "\n";
- _loc3_ = _loc3_ + 1;
- }
- return _loc4_;
- }
- function §#63§(§#467§, §#463§)
- {
- return Math.floor(§#467§ / §#463§ * 100);
- }
- function §#272§(§#455§)
- {
- var _loc3_ = 0;
- var _loc1_ = 0;
- while(_loc1_ < §#455§.length)
- {
- _loc3_ += §#455§[_loc1_];
- _loc1_ = _loc1_ + 1;
- }
- return Math.round(_loc3_ / §#455§.length);
- }
- }
-